package jmine.tec.persist.schema.impl.elements.type;

import java.util.Collections;
import java.util.List;
import java.util.Set;

import jmine.tec.persist.schema.impl.elements.ColumnTypeElement;

import org.hibernate.type.Type;

/**
 * Estratégia sentinela para tratamento de tipos. É aplicável à todas as colunas e não tem qualquer efeito.
 * 
 * @author lundberg
 */
public class EmptyTypeStrategy implements TypeStrategy {

    /**
     * {@inheritDoc}
     */
    public Set<AllowedValue> getAllowedValues(Class<?> returnedClass) {
        throw new IllegalStateException();
    }

    /**
     * {@inheritDoc}
     */
    public boolean hasLimitedAllowedValues() {
        return false;
    }

    /**
     * {@inheritDoc}
     */
    public void inferTypeParameters(ColumnTypeElement columnType, Class<?> returnedClass) {
        // OK
    }

    /**
     * {@inheritDoc}
     */
    public boolean matches(ColumnTypeElement columnTypeElement, Type type) {
        return true;
    }

    /**
     * {@inheritDoc}
     */
    public List<String> checkUserDefinedValues(ColumnTypeElement columnType, Class<?> returnedClass) {
        return Collections.emptyList();
    }

    /**
     * {@inheritDoc}
     */
    public int correctSqlType(Type type, int current) {
        return current;
    }
}